import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:ls_work/res/colors.dart';
import 'package:ls_work/ui/service_order/service_order_detail_info_widget.dart';
import 'package:ls_work/ui/service_order/service_order_process_widget.dart';
import 'package:ls_work/viewmodel/service_order/service_order_detail_view_model.dart';

class ServiceOrderDetailPage extends BaseStatefulMvvmWidget {
  final bool showDetail;
  final String orderId;
  final String? handleStatus;
  ServiceOrderDetailPage({required this.showDetail,required this.orderId,this.handleStatus});

  @override
  State<StatefulWidget> createState() => _ServiceOrderDetailState();
}

class _ServiceOrderDetailState
    extends BaseMvvmState<ServiceOrderDetailViewModel, ServiceOrderDetailPage> with SingleTickerProviderStateMixin {

  BuildContext? pageContext;

  @override
  Widget buildLoadingContentView() {
    return LayoutBuilder(builder: (context,cons){
      return viewModel.contentView(context);
    });
  }


  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return Scaffold(
      backgroundColor: Colours.bg_color,
      appBar: AppBar(
        title: Text('服务单详情'),
      ),
      body: loadingContentWidget,
    );
  }

  @override
  ServiceOrderDetailViewModel createViewModel() {
    return ServiceOrderDetailViewModel(context,this,widget.showDetail,widget.orderId,handleStatus: widget.handleStatus??"");
  }

  @override
  void onViewModelCreated() {
    super.onViewModelCreated();
  }

  @override
  void onRetryClick() {}
}
